package proxy.d.impl;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class IntermediaryInvocationHandler implements InvocationHandler {
    private Object target;

    public void setTarget(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("寻找房源");
        System.out.println("沟通看房时间");

        Object look = method.invoke(target,args);

        System.out.println("跟进卖家");
        return "看房的意见："+look;
    }
}
